package org.example.ioc_01;

import org.springframework.beans.factory.FactoryBean;

public class JavaBeanFactoryBean implements FactoryBean<JavaFactoryBean> {
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Override
    public JavaFactoryBean getObject() throws Exception {
        JavaFactoryBean javaFactoryBean = new JavaFactoryBean();
        javaFactoryBean.setName(name);
        return javaFactoryBean;
    }

    @Override
    public Class<?> getObjectType() {
        return JavaFactoryBean.class;
    }

    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
